import { IPSDETreeUAColumn } from './ipsdetree-uacolumn';
import { PSDETreeColumnImpl } from './psdetree-column-impl';
import { IPSDEUIActionGroup } from '../../dataentity/uiaction/ipsdeuiaction-group';

export class PSDETreeUAColumnImpl extends PSDETreeColumnImpl implements IPSDETreeUAColumn {
  get dataItemName(): string {
    return this.M.dataItemName;
  }

  protected psdeuiactiongroup: IPSDEUIActionGroup | null = null;

  getPSDEUIActionGroup(): IPSDEUIActionGroup | null {
    if (this.psdeuiactiongroup != null) return this.psdeuiactiongroup;
    const value = this.M.getPSDEUIActionGroup;
    if (value == null) {
      return null;
    }
    this.psdeuiactiongroup = this.getPSModel4('dataentity.uiaction.IPSDEUIActionGroup', value, 'getPSDEUIActionGroup') as IPSDEUIActionGroup;
    return this.psdeuiactiongroup;
  }

  get psDEUIActionGroup(): IPSDEUIActionGroup | null {
    return this.getPSDEUIActionGroup();
  }

  getPSDEUIActionGroupMust(): IPSDEUIActionGroup {
    const value = this.getPSDEUIActionGroup();
    if (value == null) {
      throw new Error('未指定界面行为组');
    }
    return value;
  }

  get cls(): string {
    return 'PSDETreeUAColumnImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'control.tree.IPSDETreeUAColumn') return true;
    return super.instanceof(cls);
  }
}
